
import React from 'react';
import BaseDynamicRule from '../BaseDynamicRule';
import type { Rules } from '../BaseDynamicRule';
import RULE_TYPE from './RuleType';

export type RuleType =
  'doctorsNumberWithFixed'
  | 'doctorsNumberWithPercent'
  | 'customerPriceWithFixed'
  | 'customerPriceWithPercent';

interface Props {
  type: RuleType;
  dataSource?: Rules[];
  onChange?: (param?: any) => void;
}

const DynamicRules: React.FC<Props> = (props) => {
  const { type = "customerPriceWithPercent", ...rest } = props;
  return <BaseDynamicRule {...RULE_TYPE[type]} {...rest} />
}

export default DynamicRules;
